<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<div class="panel panel-default">
    <div class="panel-heading">
        <h3>大会设置</h3>
    </div>
    <div class="panel-body" style="min-height: 500px">
        <div class="form-group">
            <label>大会名称</label>
            <input class="form-control" disabled type="text" ng-model="config.title">
        </div>
        <div class="form-group">
            <label>开始时间</label>
            <div class="form-control">{{config.startTime | date:'yyyy-MM-dd'}}</div>
        </div>
        <div class="form-group">
            <label>附议结束时间</label>
            <div class="form-control">{{config.motionClosingTime | date:'yyyy-MM-dd'}}</div>
        </div>
        <div class="form-group">
            <label>大会结束时间</label>
            <div class="form-control">{{config.endTime | date:'yyyy-MM-dd'}}</div>
        </div>
        <div class="well">
            <div class="center-block" style="width:200px">
                <button class="btn btn-danger" ng-click="closeMotion()"
                        ng-show="!config.motionClosingTime">
                    结束附议
                </button>

                <button class="btn btn-danger" ng-click="close()"
                        ng-show="config.motionClosingTime && !checkNewConfig()">
                    结束大会
                </button>

                <button class="btn btn-primary" ng-show="checkNewConfig()"
                        ng-click="createNewConfigDialog()">
                    新建大会
                </button>
            </div>
        </div>
    </div>
</div>
<div class="modal fade" id="createNewConfigDialog">
    <div class="modal-header">
        <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
        <h3>新建大会</h3>
    </div>
    <div class="modal-body">
        <div class="form-group">
            <label>大会名称</label>
            <input type="text" placeholder="请输入大会名称"
                   ng-model="newConfig.title" class="form-control" required>
        </div>
        <div class="form-group">
            <label>结束时间</label>
            <div class='input-group date' id='datetimepicker1'>
                <input type='text' class="form-control" ng-model="newConfig.endTime"/>
                <span class="input-group-addon">
                    <span class="fa fa-calendar"></span>
                </span>
            </div>
            <script>
                $(function () {
                    $('#datetimepicker1').datepicker({
                        format: 'yyyy-mm-dd',
                        language : 'zh-CN'
                    });
                });
            </script>
        </div>
    </div>
    <div class="modal-footer">
        <button type="button" data-dismiss="modal" class="btn btn-danger">取消</button>
        <button type="button" class="btn btn-primary" ng-click="createNewConfig()">创建</button>
    </div>
</div>